<!DOCTYPE html>
<html>
	<head>
		<title>网页锚点跳转</title>
		<meta charset="utf-8">
		<script>
			
				function setArchor(){
					location.hash="page1";
				}
				function setArchor2(){
					location.hash="page2";
				}
			
		</script>
	</head>
	<body>
		<button onclick="setArchor()">跳到第一页</button>
		<button onclick="setArchor2()">跳到第二页</button>
		<div style="height:1000px;">
		</div>
		<a name="page1">这是第一页</a>
		<div style="height:1000px;"></div>
		<a name="page2">这是第二页</a>
		<div style="height:1000px;"> </div>
	</body>
</html>